package main

import "fmt"

func main() {
	var data map[string]int
	fmt.Println(data == nil)
	fmt.Println(len(data) == 0)

	ages := map[string]int{
		"alice":   31,
		"charlie": 34,
	}
	fmt.Println(ages["alice"])
	fmt.Println(ages)
	delete(ages, "alice")
	ages["charlie"]++
	fmt.Println(ages)

	if age, ok := ages["bob"]; !ok {
		fmt.Println("bob not exists")
	} else {
		fmt.Println(age)
	}
}

func equal(x, y map[string]int) bool {
	if len(x) != len(y) {
		return false
	}
	for k, v := range x {
		if kv, ok := y[k]; !ok || kv != v {
			return false
		}
	}
	return true
}
